package com.iscas.tech.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.iscas.tech.entity.AtNewsattach;
import com.iscas.tech.param.AtNewsattachPageParam;
import com.iscas.tech.vo.AtNewsattachQueryVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 新闻附件表 Mapper 接口
 *
 * @author yangyi
 * @since 2020-10-26
 */
@Repository
public interface AtNewsattachMapper extends BaseMapper<AtNewsattach> {

    /**
     * 获取分页对象
     *
     * @param page
     * @param atNewsattachPageParam
     * @return
     */
    IPage<AtNewsattachQueryVo> getAtNewsattachPageList(@Param("page") Page page, @Param("param") AtNewsattachPageParam atNewsattachPageParam);

    /**
     * 删除新闻下所有附件信息
     *
     * @return 删除结果
     * @throws Exception 删除异常
     */
    boolean deleteByNewsId(@Param("id") Integer id) throws Exception;
}
